Add 32 bit version of plat_get_syscnt_freq
authorAntonio Nino Diaz <[email protected]>
Wed, 18 May 2016 15:53:31 +0000 (16:53 +0100)
committerAntonio Nino Diaz <[email protected]>
Fri, 20 May 2016 14:29:03 +0000 (15:29 +0100)
Added plat_get_syscnt_freq2, which is a 32 bit variant of the 64 bit
plat_get_syscnt_freq. The old one has been flagged as deprecated.
Common code has been updated to use this new version. Porting guide
has been updated.

Change-Id: I9e913544926c418970972bfe7d81ee88b4da837e

bl31/aarch64/bl31_arch_setup.c
docs/porting-guide.md
include/plat/common/platform.h
plat/common/aarch64/plat_common.c
services/std_svc/psci/psci_suspend.c

index 0871b419598c099bfa8d3a8bcfadbb66932c673e..3deacbae0edb9dcde1842dc6f62f47d242882d51 100644 (file)
@@ -44,7 +44,7 @@
 void bl31_arch_setup(void)
 {
        /* Program the counter frequency */
-       write_cntfrq_el0(plat_get_syscnt_freq());
+       write_cntfrq_el0(plat_get_syscnt_freq2());
 
        /* Initialize the cpu_ops pointer. */
        init_cpu_ops();
index 5004d3099faac74f581b05ff7b27913c4c4d3ddc..0cd36134f4b2dd3b0b88317260d673f0729d462c 100644 (file)
@@ -1529,10 +1529,10 @@ state. This function must return a pointer to the `entry_point_info` structure
 (that was copied during `bl31_early_platform_setup()`) if the image exists. It
 should return NULL otherwise.
 
-### Function : plat_get_syscnt_freq() [mandatory]
+### Function : plat_get_syscnt_freq2() [mandatory]
 
     Argument : void
-    Return   : uint64_t
+    Return   : unsigned int
 
 This function is used by the architecture setup code to retrieve the counter
 frequency for the CPU's generic timer.  This value will be programmed into the
index 42260e9fec564de6390c4304aba78a55230165c8..a08a12e40bc2e4ca8e1b0a113b8369a37cabd8cb 100644 (file)
@@ -56,7 +56,9 @@ struct image_desc;
 /*******************************************************************************
  * Mandatory common functions
  ******************************************************************************/
-unsigned long long plat_get_syscnt_freq(void);
+unsigned long long plat_get_syscnt_freq(void) __deprecated;
+unsigned int plat_get_syscnt_freq2(void);
+
 int plat_get_image_source(unsigned int image_id,
                        uintptr_t *dev_handle,
                        uintptr_t *image_spec);
index 9070c613cec54f6ad95bebe159bada92367ba4a9..432234153ccee3eea3840aadf32eee15c9e36539 100644 (file)
@@ -40,6 +40,9 @@
 #pragma weak bl31_plat_enable_mmu
 #pragma weak bl32_plat_enable_mmu
 #pragma weak bl31_plat_runtime_setup
+#if !ERROR_DEPRECATED
+#pragma weak plat_get_syscnt_freq2
+#endif /* ERROR_DEPRECATED */
 
 void bl31_plat_enable_mmu(uint32_t flags)
 {
@@ -74,3 +77,14 @@ unsigned int platform_core_pos_helper(unsigned long mpidr)
 }
 #endif
 
+
+#if !ERROR_DEPRECATED
+unsigned int plat_get_syscnt_freq2(void)
+{
+       unsigned long long freq = plat_get_syscnt_freq();
+
+       assert(freq >> 32 == 0);
+
+       return (unsigned int)freq;
+}
+#endif /* ERROR_DEPRECATED */
index bd0c5dbcd751334fcc9287d3b91bd9de9947beae..367bb32a6e7e874f85f6b752cf0167f58d3dec26 100644 (file)
@@ -214,7 +214,7 @@ exit:
 void psci_cpu_suspend_finish(unsigned int cpu_idx,
                             psci_power_state_t *state_info)
 {
-       unsigned long long counter_freq;
+       unsigned int counter_freq;
        unsigned int max_off_lvl;
 
        /* Ensure we have been woken up from a suspended state */
@@ -238,7 +238,7 @@ void psci_cpu_suspend_finish(unsigned int cpu_idx,
        psci_do_pwrup_cache_maintenance();
 
        /* Re-init the cntfrq_el0 register */
-       counter_freq = plat_get_syscnt_freq();
+       counter_freq = plat_get_syscnt_freq2();
        write_cntfrq_el0(counter_freq);
 
        /*